package com.lzh.swagger.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * @author zhehen.lu
 * @date 2024/7/3 14:54
 */
@ConfigurationProperties(prefix = "lzh.swagger")
@Data
public class SwaggerProperties {
    private Boolean enabled = true;
    private String host;
    private Map<String, DocketInfo> docket = new LinkedHashMap<>();

    @Data
    public static class Contact {
        private String name = "";
        private String url = "";
        private String email = "";
    }

    @Data
    public static class GlobalOperationParameter {
        private String name = "";
        private String desc = "";
        private String modelRef = "";
        private String parameterType = "";
        private Boolean require;
    }

    @Data
    public static class DocketInfo {
        private String title = "";
        private String desc = "";
        private String version = "";
        private String license = "";
        private String licenseUrl = "";
        private String termsOfServiceUrl = "";
        private SwaggerProperties.Contact contact = new SwaggerProperties.Contact();
        private String basePackage = "";
        private List<String> basePath = new ArrayList<>();
        private List<String> excludePath = new ArrayList<>();
        private List<SwaggerProperties.GlobalOperationParameter> globalOperationParameters;
    }
}
